{% load staticfiles %}
{% load notifications_tags %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="小涛博客，是一个记录技术心得和资源分享，记录生活点滴，分享兴趣爱好的个人博客。">
    <meta name="keywords" content="小涛博客,个人博客,原创博客,资源下载,IT技术分享">
    <meta name="google-site-verification" content="Psw0cLc1K5ft-VCMlNu0FvUKL-eYUtFpflkn1EiyztU" />
	<meta name="baidu-site-verification" content="GJkmTRhPJR" />
	<meta name="360-site-verification" content="0776aaf09c242ecab3b91884a586025c" />
	<meta name="msvalidate.01" content="A16E169A5252E5E237E5378BD2FD21B2" />
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="{% static 'css/base.css' %}"/>
    {% block header_extends %}{% endblock %}
    <!--[if lt IE 9]>
      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/zooming/2.1.0/zooming.js"></script>
    <script type="text/javascript" src="{% static 'js/scrollReveal.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/time.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/common.js' %}"></script>
    <script type="text/javascript" src="{% static 'notifications/notify.js' %}"></script>
</head>
<body>
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container-fluid container">
            <div class="navbar-header">
                <a class="navbar-brand" href="{% url 'home' %}">小涛博客</a>
                <button class="navbar-toggle collapsed"  data-toggle="collapse" data-target="#navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div id="navbar-collapse" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="{% block nav_home_active %}{% endblock %}">
                        <a href="{% url 'home' %}"><i class="fa fa-home"></i>&nbsp;首页</a>
                    </li>
                    <li class="{% block nav_article_active %}{% endblock %}">
                        <a href="{% url 'blog_list' %}"><i class="fa fa-book"></i>&nbsp;文章</a>
                    </li>
                    <li class="{% block nav_share_active %}{% endblock %}">
                        <a href="{% url 'share_list' %}"><i class="fa fa-cloud-download"></i>&nbsp;资源分享</a>
                    </li>
                    <li class="{% block nav_time_active %}{% endblock %}">
                        <a href="{% url 'timer_list' %}"><i class="fa fa-calendar"></i>&nbsp;时间轴</a>
                    </li>
                    <li class="{% block nav_comment_active %}{% endblock %}">
                        <a href="{% url 'comment' %}"><i class="fa fa-comments"></i>&nbsp;留言墙</a>
                    </li>
                </ul>



                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <form id="search" action="{% url 'search' %}" method="GET">
                            <button for="search-input" type="submit" class="sub_btn">
                                <i class="fa fa-search" aria-hidden="true"></i><span class="sr-only">搜索图标</span>
                            </button>
                            <input id="search-input" class="form-control" placeholder="搜索..." value="" name="p" autocomplete="off" spellcheck="false" autocorrect="off" tabindex="1">
                        </form>
                    </li>
                    {% if not user.is_authenticated %}
                        <li>
                            {% if request.GET.from %}
                                <a href="{% url 'login' %}?from={{ request.GET.from }}">
                                    <i class="fa fa-bell" aria-hidden="true"></i>&nbsp;登录
                                </a>
                            {% else %}
                                <a href="{% url 'login' %}?from={{ request.get_full_path }}">
                                    <i class="fa fa-bell" aria-hidden="true"></i>&nbsp;登录
                                </a>
                            {% endif %}
                        </li>
                        <li>
                            {% if request.GET.from %}
                                <a href="{% url 'register' %}?from={{ request.GET.from }}">
                                   <i class="fa fa-sign-in"></i>&nbsp;注册
                                </a>
                            {% else %}
                                <a href="{% url 'register' %}?from={{ request.get_full_path }}">
                                    <i class="fa fa-sign-in"></i>&nbsp;注册
                                </a>
                            {% endif %}
                        </li>
                    {% else %}
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button">
                                你好，{{ user.get_nickname_or_username }}
                                <span class="badge unread-count live_notify_badge">
                                    {% if unread_count > 0 %}{{ unread_count }}{% endif %}
                                </span>
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="{% url 'user_info' %}"><i class="fa fa-user"></i>&nbsp;个人资料</a>
                                </li>
                                <li>
                                    <a href="{% url 'my_notifications' %}">
                                        <i class="fa fa-pencil-square-o"></i>&nbsp;我的消息
                                        <span class="badge unread-count live_notify_badge">
                                            {% if unread_count > 0 %}{{ unread_count }}{% endif %}
                                        </span>
                                    </a>
                                </li>
                                {% if user.is_staff or user.is_superuser %}
                                    <li>
                                        <a href="{% url 'admin:index' %}"><i class="fa fa-cog"></i>&nbsp;后台管理</a>
                                    </li>
                                {% endif %}
                                <li>
                                    <a href="{% url 'logout' %}?from={{ request.get_full_path }}">
                                        <i class="fa fa-sign-out"></i>&nbsp;退出
                                    </a>
                                </li>
                            </ul>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </div>

    {% block content %}{% endblock %}

    <!-- footer -->
    <footer class="footer">
      <div class="container">
        <p class="copyright">
            <a href="//www.miitbeian.gov.cn/" target="_blank">蜀ICP备18020741号-2</a>
        </p>
        <p class="link">
            <a href="/sitemap.xml" target="_blank"><i class="fa fa-sitemap"></i>&nbsp;网站地图</a>
            <a href="/rss" target="_blank"><i class="fa fa-rss-square"></i>&nbsp;RSS订阅</a>
        </p>
        <p class="beian">Copyright © 2018 tengxt All Rights Reserved.&nbsp;&nbsp;<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1276449680'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s96.cnzz.com/z_stat.php%3Fid%3D1276449680%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script></p>
      </div>
    </footer>
    <a href="javascript:void(0);" class="cd-top cd-fade-out"></a>
    {% register_notify_callbacks callbacks='my_special_notification_callback' %}
    {% block script_extends %}{% endblock %}
</body>
</html>